using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using FluentData;
using AdverseEventReportSystem.Model;
using AdverseEventReportSystem.Repository;

namespace AdverseEventReportSystem.Service
{
    public class AdverseEventYaChuangFsbwService : BaseService<AdverseEventYaChuangFsbw>
    {

        #region Update

        public static int Update(AdverseEventYaChuangFsbw entity, IDbContext context = null)
        {
            return AdverseEventYaChuangFsbwRepository.GetInstance().Update(entity, context);
        }

        #endregion

        #region Add

        public static int Add(AdverseEventYaChuangFsbw entity, IDbContext context = null)
        {
            return AdverseEventYaChuangFsbwRepository.GetInstance().Add(entity, context);
        }

        #endregion

        #region 获取单个实体 通过主键ID

        /// <summary>
        /// 获取单个实体 通过主键ID
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <param name="context">数据库连接对象</param>
        /// <returns></returns>
        public static AdverseEventYaChuangFsbw GetQuerySingleByID(int id, IDbContext context = null)
        {
            return AdverseEventYaChuangFsbwRepository.GetInstance().GetQuerySingleByID(id, context);
        }

        #endregion

        #region 删除操作  通过ID

        /// <summary>
        /// 删除操作  通过ID
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <param name="context">数据库对象</param>
        /// <returns></returns>
        public static int DelByID(int id, IDbContext context = null)
        {
            return AdverseEventYaChuangFsbwRepository.GetInstance().DelByID(id, context);
        }

        #endregion

        #region 根据事件ID获取压疮发生部位

        /// <summary>
        /// 根据事件ID获取压疮发生部位
        /// </summary>
        /// <param name="eventID"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public static DataTable GetAdverseEventYaChuangFsbwTable(int eventID, IDbContext context = null)
        {
            return AdverseEventYaChuangFsbwRepository.GetInstance().GetAdverseEventYaChuangFsbwTable(eventID, context);
        }

        #endregion

        #region 根据不良事件ID删除

        /// <summary>
        /// 根据事件ID删除
        /// </summary>
        /// <param name="eventID">不良事件ID</param>
        /// <param name="context">数据库连接对象</param>
        /// <returns></returns>
        public static int DelByEventID(int eventID, IDbContext context = null)
        {
            return AdverseEventYaChuangFsbwRepository.GetInstance().DelByEventID(eventID, context);
        }

        #endregion
    }
}





